﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using Tools.Model;

namespace Tools.BusinessLogic.Service
{
    public interface IServiceBase<TEntity>
        where TEntity : EntityBase
    {
        void Add(TEntity entity);
        void Delete(TEntity entity);
        void Update(TEntity entity);


        TEntity GetById(object Id);
        //IEnumerable<TEntity> Get(Expression<Func<TEntity, bool>> filter, Func<IQueryable<TEntity>,
        //    IOrderedQueryable<TEntity>> orderBy, string includeProperties);
        IEnumerable<TEntity> GetAll();
        TEntity SingleOrDefault(Expression<Func<TEntity, bool>> filter);

        int Save();
    }
}
